<?php



namespace App\Services\Company\Models;

use App\Services\Member\Models\User;
use App\Services\Order\Models\Order;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class   CompanyBalanceRecord extends Model
{
    use SoftDeletes, HasFactory;

    const TYPE_DEFAULT = 0;
    const TYPE_ORDER_DRAW = 1;
    const TYPE_ORDER_WITHDRAW = 2;
    const TYPE_ORDER_WITHDRAW_BACK = 3;

    protected $table = 'shop_balance_records';

    protected $fillable = [
        'user_id',  'total', 'desc','company_id','order_id',
    ];
    public function user()
    {
        return $this->belongsTo(User::class, 'user_id');
    }

    public function order()
    {
        return $this->belongsTo(Order::class, 'order_id');
    }
}
